﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true"
    CodeBehind="EstiloList.aspx.cs" Inherits="Emporium_Web.EstiloList" Theme="Constellation" %>

<%@ MasterType VirtualPath="~/Menu.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register TagPrefix="emporium" TagName="ClienteSearch" Src="~/Search/ClienteSearch.ascx" %>
<%@ Register TagPrefix="emporium" TagName="TemporadaSearch" Src="~/Search/TemporadaSearch.ascx" %>
<%@ Register TagPrefix="emporium" TagName="EstiloImagenShow" Src="~/Controls/EstiloImagenShow.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Listado de Estilos</title>
    <script type="text/javascript" src="js/funciones.grid.js"></script>
    <script type="text/javascript">
        var hdnSeleccionId = '<%= this.hdnSeleccion.ClientID %>';
    </script>
    <script type="text/javascript" src="js/funciones.grid.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- Content -->
    <article class="container_12">
		<section class="grid_12">
			<div class="block-border">
			<form runat="server" class="block-content form" id="table_form">
                <ajaxToolkit:ToolkitScriptManager ID="toolk" runat="server"  EnableScriptGlobalization="true" EnableScriptLocalization="true"></ajaxToolkit:ToolkitScriptManager>

                    <h1>Listado de Estilos</h1>

                <div style="width: 100%; padding-top: 20px;">
                    <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 100px; float: left;">
                            <label>
                                 C&oacute;digo</label>
                        </div>
                        <div align="left" style="width: 70%; float: left;">
                            <asp:TextBox ID="txtCodigo" name="simple-required" runat="server" Width="100px"></asp:TextBox>
                        </div>
                    </div>     
                    
                    
                    <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 100px; float: left;">
                            <label>
                                  Cliente</label>
                        </div>
                        <div align="left" style="width: 70%; float: left;">
                            <emporium:ClienteSearch ID="clienteSearch" runat="server" EnabledTextBox ="true" />
                        </div>
                    </div>    
                    
                    
                     <div style="width: 100%; height: 45px; float: inherit;">
                        <div style="width: 100px; float: left;">
                            <label>
                                   Temporada</label>
                        </div>
                        <div align="left" style="width: 40%; float: left; text-align:left;">
                              <emporium:TemporadaSearch ID="temporadaSearch" runat="server"/>    
                        </div>

                        <div align="left" style="width: 20%; float: left; text-align:left;">
                              <asp:LinkButton ID="btnBuscar" runat="server" Text="Buscar" CssClass="button red"
                                      OnClick="btnBuscar_Click" />
                        </div>
                    </div>   
                   
                 </div>

                    <asp:HiddenField ID="hdnSeleccion" runat="server" />
                  
                  <div style="width: 100%;">
					<ul class="message error no-margin" runat="server" id="errorMessage">
					    <li><asp:Label runat="server" ID="lblErrorMessage"></asp:Label></li>
					</ul>
                    <ul class="message warning no-margin" runat="server"  id="warningMessage">
					    <li><asp:Label runat="server" ID="lblWarningMessage"></asp:Label></li>
					</ul>                   
                   </div>

                    <div class="block-controls">
                        <emporium:pager ID="gvPager" runat="server" Visible="false" PageSize="5" OnPageChanged="gvPagerPageChanged" />
                    </div>
                   
                    <div class="no-margin">
					<asp:GridView ID="gvEstilos" runat="server" SkinID="gridviewSkin" PageSize="5" 
                            Width="100%" onsorting="gvEstilos_Sorting" AllowSorting="True" 
                            onrowcommand="gvEstilos_RowCommand">
                        <Columns>                   
							<asp:TemplateField>
                                <ItemTemplate>
                                      <input id="rbSelect" type="radio" name="selectGroup" value="rbSelect" onclick="javascript:Check('<%# Eval("Id") %>');"/>
								</ItemTemplate>
								<ItemStyle HorizontalAlign="Left" Width="2%" />
							</asp:TemplateField>
                             <asp:TemplateField>
                                <HeaderStyle HorizontalAlign="Left" ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>
                                <span class="column-sort">
									<asp:LinkButton Name="lnkSortUpId" ID="lnkSortUpId" CssClass="sort-up" runat="server" CommandName="SortUp" CommandArgument="Id"/>
                                    <asp:LinkButton Name="lnkSortDownId" ID="lnkSortDownId" CssClass="sort-down" runat="server"  CommandName="SortDown" CommandArgument="Id"/>
								</span>
                                Cod.
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnConsultar" runat="server" Text='<%# Eval("Id", "{0:00000}")%>' OnClick="btnConsultar_Click"  />
								</ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderStyle ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>
                                    <span class="column-sort">
									    <asp:LinkButton ID="lnkSortUpDescripcion" CssClass="sort-up" runat="server" CommandName="SortUp" CommandArgument="Descripcion"/>
                                        <asp:LinkButton ID="lnkSortDownDescripcion" CssClass="sort-down" runat="server"  CommandName="SortDown" CommandArgument="Descripcion"/>
								    </span>
                                    Descripción
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# Eval("Descripcion")%>
                                </ItemTemplate>
                            </asp:TemplateField>

                              <asp:TemplateField>
                                <HeaderStyle ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>
                                    <span class="column-sort">
									    <asp:LinkButton ID="lnkSortUpCliente" CssClass="sort-up" runat="server" CommandName="SortUp" CommandArgument="Cliente"/>
                                        <asp:LinkButton ID="lnkSortDownCliente" CssClass="sort-down" runat="server"  CommandName="SortDown" CommandArgument="Cliente"/>
								    </span>
                                    Cliente
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# Eval("TG_Cliente.Nombre")%>
                                </ItemTemplate>
                            </asp:TemplateField>

                              <asp:TemplateField>
                                <HeaderStyle ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>
                                    <span class="column-sort">
									    <asp:LinkButton ID="lnkSortUpTemporada" CssClass="sort-up" runat="server" CommandName="SortUp" CommandArgument="Temporada"/>
                                        <asp:LinkButton ID="lnkSortDownTemporada" CssClass="sort-down" runat="server"  CommandName="SortDown" CommandArgument="Temporada"/>
								    </span>
                                    Temporada
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# Eval("TG_Temporada.Descripcion")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            

                            <asp:TemplateField>
                                <HeaderStyle ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>
                                    <span class="column-sort">
									    <asp:LinkButton ID="lnkSortUpCodigoCliente" CssClass="sort-up" runat="server" CommandName="SortUp" CommandArgument="CodigoCliente"/>
                                        <asp:LinkButton ID="lnkSortDownCodigoCliente" CssClass="sort-down" runat="server"  CommandName="SortDown" CommandArgument="CodigoCliente"/>
								    </span>
                                    Cod.Cliente
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# Eval("CodigoCliente")%>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField>
                                <HeaderStyle ForeColor="White" Font-Bold="true"></HeaderStyle>
                                <HeaderTemplate>
                                    <span class="column-sort">
									    <asp:LinkButton ID="lnkSortUpFechaRegistro" CssClass="sort-up" runat="server" CommandName="SortUp" CommandArgument="FechaRegistro"/>
                                        <asp:LinkButton ID="lnkSortDownFechaRegistro" CssClass="sort-down" runat="server"  CommandName="SortDown" CommandArgument="FechaRegistro"/>
								    </span>
                                    F.Registro
                                </HeaderTemplate>
                                <ItemTemplate>
                                     <%# Eval("FechaRegistro", "{0:dd/MM/yyyy}")%>
                                </ItemTemplate>
                            </asp:TemplateField>

                          
                            <asp:TemplateField>                             
                                <ItemTemplate> 
                                   <asp:LinkButton ID="lnkImagenes" runat="server" CausesValidation="false" CommandName="Imagenes" CommandArgument='<%# Eval("Id") %>' Text="Imagenes"></asp:LinkButton> 
                                </ItemTemplate>
							</asp:TemplateField>


						</Columns>
						<PagerSettings Visible="false" />
					</asp:GridView>
				 </div>
                <ul class="message no-margin">
                    <li>
                        <asp:Label ID="lblMensajeGridFooter" runat="server"></asp:Label>
                    </li>
				</ul>
				<div class="block-footer">
                    <img src="images/icons/fugue/arrow-curve-000-left.png" width="16" height="16" class="picto"> 
                    <asp:LinkButton ID="btnAdicionar" runat="server" Text="Adicionar" CssClass="button" onclick="btnAdicionar_Click" />
				    <asp:LinkButton ID="btnModificar" runat="server" Text="Modificar" CssClass="button" onclick="btnModificar_Click" />
					<asp:LinkButton ID="btnEliminar" runat="server" Text="Eliminar" CssClass="button" onclick="btnEliminar_Click" OnClientClick="return DeleteRegs();"/>                    
                    <asp:LinkButton ID="btnImagenes" runat="server" Text="Imágenes" 
                        CssClass="button" onclick="btnImagenes_Click" />            
                    <asp:LinkButton ID="btnVariantes" runat="server" Text="Variantes" 
                        CssClass="button" onclick="btnVariantes_Click"/>                            
                    <asp:LinkButton ID="btnConsumos" runat="server" Text="Consumos" 
                        CssClass="button" onclick="btnConsumos_Click"/>                            
                </div>

                <emporium:EstiloImagenShow runat="server" ID="estiloImagenShow" />
			</form>
			</div>
		</section>
	</article>
</asp:Content>
